home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmSpeaker
- BackColor = &H00008080&
- Caption = "The Speaker Program"
- ClientHeight = 3330
- ClientLeft = 420
- ClientTop = 1650
- ClientWidth = 9000
- ForeColor = &H00000000&
- Height = 3735
- Icon = SPEAKER.FRX:0000
- Left = 360
- LinkTopic = "Form1"
- ScaleHeight = 3330
- ScaleWidth = 9000
- Top = 1305
- Width = 9120
- Begin CheckBox chkAutoRepeat
- BackColor = &H00008080&
- Caption = "&Auto Repeat"
- Enabled = 0 'False
- Height = 255
- Left = 3120
- TabIndex = 13
- Top = 3000
- Width = 1455
- End
- Begin OptionButton optWav3
- BackColor = &H00008080&
- Caption = "3"
- Height = 375
- Left = 360
- TabIndex = 12
- Top = 2760
- Width = 495
- End
- Begin OptionButton optWav2
- BackColor = &H00008080&
- Caption = "2"
- Height = 255
- Left = 360
- TabIndex = 11
- Top = 2520
- Width = 495
- End
- Begin OptionButton optWav1
- BackColor = &H00008080&
- Caption = "1"
- ForeColor = &H00000000&
- Height = 375
- Left = 360
- TabIndex = 10
- Top = 2160
- Value = -1 'True
- Width = 495
- End
- Begin Frame Frame2
- BackColor = &H00008080&
- Caption = "WAV File:"
- ForeColor = &H00000000&
- Height = 1335
- Left = 120
- TabIndex = 9
- Top = 1920
- Width = 1095
- End
- Begin CheckBox chkMultitask
- BackColor = &H00008080&
- Caption = "&Multitasking"
- ForeColor = &H00000000&
- Height = 255
- Left = 1440
- TabIndex = 8
- Top = 3000
- Width = 1455
- End
- Begin TEGOMM TegommPC
- BorderStyle = 0 'None
- DeviceType = ""
- FileName = ""
- Height = 330
- Left = 5400
- pcSpeed = 100
- pcTaskInterval = 0
- RecordMode = 0 'Insert
- Shareable = 0 'False
- Silent = 0 'False
- TabIndex = 7
- Tempo = 0
- Top = 3000
- UpdateInterval = 0
- Width = 3510
- End
- Begin CommandButton cmdExit
- BackColor = &H00808080&
- Caption = "E&xit"
- Height = 975
- Left = 5280
- TabIndex = 6
- Top = 1920
- Width = 3615
- End
- Begin CommandButton cmdFast
- BackColor = &H00808080&
- Caption = "&Fastest"
- Height = 375
- Left = 8040
- TabIndex = 5
- Top = 1080
- Width = 735
- End
- Begin CommandButton cmdNormal
- BackColor = &H00808080&
- Caption = "&Normal"
- Height = 375
- Left = 2880
- TabIndex = 4
- Top = 1080
- Width = 735
- End
- Begin CommandButton cmdSlow
- BackColor = &H00808080&
- Caption = "&Slowest"
- Height = 375
- Left = 240
- TabIndex = 3
- Top = 1080
- Width = 735
- End
- Begin HScrollBar hsbSpeed
- Height = 495
- Left = 240
- TabIndex = 2
- Top = 480
- Width = 8535
- End
- Begin Frame Frame1
- BackColor = &H00008080&
- Caption = "Speed"
- Height = 1455
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 8775
- End
- Begin CommandButton cmdPlay
- BackColor = &H00808080&
- Caption = "&Play"
- Height = 975
- Left = 1440
- TabIndex = 0
- Top = 1920
- Width = 3615
- End
- Option Explicit
- Sub chkMultitask_Click ()
- ' Enable multitasking?
- If chkMultitask.Value = 1 Then
-
- ' Set the multitask time slice to 400 milliseconds.
- TegommPC.pcTaskInterval = 400
-
- ' Enable the mouse during playback
- TegommPC.pcMouseEnabled = True
-
- ' Enable the Auto Repeat check box.
- chkAutoRepeat.Enabled = True
- Else
-
- ' No multitasking.
- TegommPC.pcTaskInterval = 0
-
- ' Disable the mouse during playback.
- TegommPC.pcMouseEnabled = False
-
- ' Disable the Auto Repeat check box.
- chkAutoRepeat.Enabled = False
- ' Set the caption of the cmdPlay button to "Play".
- cmdPlay.Caption = "&Play"
- End If
- End Sub
- Sub cmdExit_Click ()
- End
- End Sub
- Sub cmdFast_Click ()
- ' Set the hsbSpeed scroll bar to maximum value.
- hsbSpeed.Value = hsbSpeed.Max
- End Sub
- Sub cmdNormal_Click ()
- ' Set the hsbSpeed scroll bar to normal speed value.
- hsbSpeed.Value = 100
- End Sub
- Sub cmdPlay_Click ()
- ' Play or Stop?
- If TegommPC.Mode = 526 Then
- cmdPlay.Caption = "&Play"
- TegommPC.Command = "Stop"
- Else
- cmdPlay.Caption = "Sto&p"
- TegommPC.Command = "Play"
- End If
- End Sub
- Sub cmdSlow_Click ()
- ' Set the hsbSpeed scroll bar to minimum value.
- hsbSpeed.Value = hsbSpeed.Min
- End Sub
- Sub Form_Load ()
- Dim WavFile
- ' Make the multimedia control invisible.
- TegommPC.Visible = False
- ' Set the DeviceType property for playback of
- ' WAV files through the PC speaker.
- TegommPC.DeviceType = "PCSpeaker"
- ' Set the FileName property.
- WavFile = Left(App.Path, 2) + "\MVPROG\WAV\BOURB1M1.WAV"
- TegommPC.FileName = WavFile
- ' Issue an Open command.
- TegommPC.Command = "Open"
- ' If Open command failed, display an error message.
- If TegommPC.Error <> 0 Then
- MsgBox "Cannot open " + WavFile, 0, "ERROR"
- End If
- ' Set the Min and Max of the hsbSpeed scroll bar.
- hsbSpeed.Min = 50
- hsbSpeed.Max = 200
- ' Set the hsbTempo scroll bar to the normal speed.
- hsbSpeed.Value = 100
- End Sub
- Sub hsbSpeed_Change ()
- ' Set the pcSpeed property to the current value
- ' of the hsbSpeed scroll bar.
- TegommPC.pcSpeed = hsbSpeed.Value
- End Sub
- Sub optWav1_Click ()
- Dim WavFile
- ' Set the FileName property.
- WavFile = Left(App.Path, 2) + "\MVPROG\WAV\BOURB1M1.WAV"
- TegommPC.FileName = WavFile
- ' Issue an Open command.
- TegommPC.Command = "Open"
- ' If Open command failed, display an error message.
- If TegommPC.Error <> 0 Then
- MsgBox "Cannot open " + WavFile, 0, "ERROR"
- End If
- ' Set the caption of the cmdPlay button to "Play".
- cmdPlay.Caption = "&Play"
- End Sub
- Sub optWav2_Click ()
- Dim WavFile
- ' Set the FileName property.
- WavFile = Left(App.Path, 2) + "\MVPROG\WAV\STROL1M1.WAV"
- TegommPC.FileName = WavFile
- ' Issue an Open command.
- TegommPC.Command = "Open"
- ' If Open command failed, display an error message.
- If TegommPC.Error <> 0 Then
- MsgBox "Cannot open " + WavFile, 0, "ERROR"
- End If
- ' Set the caption of the cmdPlay button to "Play".
- cmdPlay.Caption = "&Play"
- End Sub
- Sub optWav3_Click ()
- Dim WavFile
- ' Set the FileName property.
- WavFile = Left(App.Path, 2) + "\MVPROG\WAV\8KENNED3.WAV"
- TegommPC.FileName = WavFile
- ' Issue an Open command.
- TegommPC.Command = "Open"
- ' If Open command failed, display an error message.
- If TegommPC.Error <> 0 Then
- MsgBox "Cannot open " + WavFile, 0, "ERROR"
- End If
- ' Set the caption of the cmdPlay button to "Play".
- cmdPlay.Caption = "&Play"
- End Sub
- Sub TegommPC_Done ()
- ' Did playback position reach the end of the file?
- If TegommPC.Position = TegommPC.Length Then
-
- ' Rewind the multimedia control.
- TegommPC.Command = "Prev"
-
- ' Play again?
- If chkAutoRepeat.Value = 1 And chkMultitask.Value = 1 Then
- TegommPC.Command = "Play"
- Else
- cmdPlay.Caption = "&Play"
- End If
-
- End If
- End Sub
-